#! /usr/bin/python
# Copyright (c) 2006 Continuous Comouting Corp.
# All rights reserved
# PP50 performance test script
# Robert Li 2010-05-03
# Version:1.0.0
# Description:
# Function test
# TODO: determine year automatically
#====================================================
import string
import sys
import wx
import wx.lib.mixins.listctrl as listmix
import wx.lib.scrolledpanel as scrolled
from wxPython.wx import *
from guihelper import IdeTestBar
ID_EXIT =  10300000
ID_VIEW =  10400000
ID_ABOUT = 20100000
class myFrame(wxFrame):
	def __init__(self, parent, ID, title):
		wxFrame.__init__(self, parent, ID, title, wxDefaultPosition,wxSize(800,600),wxMAXIMIZE_BOX|wxRESIZE_BORDER|wxCLOSE_BOX)
		self.title = title
		fmenu = wxMenu()
		fmenu.Append(ID_EXIT, "E&xit", "Exit the program")
		hmenu = wxMenu()
		hmenu.Append(ID_ABOUT, "&About", "Get info about this program")
		menubar = wxMenuBar()
		menubar.Append(fmenu, "&File")
		menubar.Append(hmenu, "&Help")
		self.SetMenuBar(menubar)
		EVT_MENU(self, ID_ABOUT, self.onAbout)
		EVT_MENU(self, ID_EXIT, self.onExit)
		box = wxBoxSizer(wxHORIZONTAL)
		#Call the Test Platform  GUI setting 
		self.testbar=IdeTestBar(self)
		box.Add(self.testbar, 1, wxEXPAND)
		self.SetAutoLayout(true)
		self.SetSizer(box)
		self.Layout()
		self.Refresh()
	def onAbout(self, event):
		dlg = wxMessageDialog(self,"""This program controls the testing of CCPU 40GbE Pkt Flex Packet boards Copyright (c) Continuous Computing, 2007
""", "About  Flex Packet 40GbE Pkt", wxOK | wxICON_INFORMATION)
		dlg.ShowModal()
	def onExit(self, event):
		self.Close(true)	
class myApp(wxApp):
	def __init__(self, unk):
		wxApp.__init__(self, unk)
	def OnInit(self):
		frame = myFrame(NULL, -1, "Flex Packet 40GbE Pkt v1.0.0")
		frame.Show(true)
		self.SetTopWindow(frame)
		return true
app = myApp(0)
app.MainLoop()
